﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using Simple.Services.System.QHSEViolationCategory.Models;

namespace Simple.Services;

/// <summary>
/// 标准文件
/// </summary>
public class QHSEHavStandardModel:ModelBase
{
    public QHSEHavStandardModel()
    {
    }

    /// <summary>
    /// ID
    /// </summary>
    [MaxLength(32)]
    public string Id { get; set; } = "";


    /// <summary>
    /// 标准编码
    /// </summary>
    [MaxLength(32)]
    public string? StandardCode { get; set; }
    /// <summary>
    /// 文件名
    /// </summary>
    [MaxLength(100)]
    public string? FileName { get; set; }
    /// <summary>
    /// 文件地址
    /// </summary>
    [MaxLength(100)]
    public string? FileUrl { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Note { get; set; }
    /// <summary>
    /// 文件
    /// </summary>
    public FileUploadItem? File { get; set; } = new FileUploadItem();
    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<QHSESysHavStandard, QHSEHavStandardModel>()
            .ForMember(d => d.Id, options => options.MapFrom(s => s.Id));

        profile.CreateMap<QHSEHavStandardModel, QHSESysHavStandard>()
            .ForMember(d => d.Id, options => options.MapFrom(s => s.Id));
    }
}
